package util;

import org.apache.zookeeper.Watcher;
import org.apache.zookeeper.ZooKeeper;

import java.io.IOException;

/**
 * Created by Administrator on 2017/3/12.
 */
public class ZkConnect extends ZooKeeper {

    private boolean is_used;

    public ZkConnect(String connectString, int sessionTimeout, Watcher watcher, boolean is_used) throws IOException {
        super(connectString, sessionTimeout, watcher);
        this.is_used = is_used;
    }

    public boolean isIs_used() {
        return is_used;
    }

    public void setIs_used(boolean is_used) {
        this.is_used = is_used;
    }


    public synchronized void releaseZkConnect(){
        this.setIs_used(Boolean.FALSE);
    }
}
